import { request } from '@/utils/request'
// 生成订单
export const makeOrder = (data) => {
  return request({
    url: '/Wechat/Order/makeOrder',
    method: 'POST',
    data
  })
}
export const getSchemeUrl = () => {
  return request({
    url: '/Wechat/Auth/getSchemeUrl',
    method: 'POST',
  })
}
// 预支付接口
export const readyPay = (data) => {
  return request({
    url: '/Wechat/Pay/readyPay',
    method: 'POST',
    data
  })
}
// 确认支付接口
export const confirmPay = (data) => {
  return request({
    url: '/Wechat/Pay/confirmPay',
    method: 'POST',
    data
  })
}
// 发起签署
export const createContract = (data) => {
  return request({
    url: '/Wechat/Order/createContract',
    method: 'POST',
    data
  })
}
// 获取签署地址
export const executeUrl = (data) => {
  return request({
    url: '/Wechat/Order/executeUrl',
    method: 'POST',
		data
  })
}
// 微信支付
export const wechatPay = (data) => {
  return request({
    url: '/Wechat/Pay/wechatPay',
    method: 'POST',
		data
  })
}

export const orderInfo = (data) => {
  return request({
    url: '/Wechat/Order/orderInfo',
    method: 'GET',
		data
  })
}

// 获取申请退款页面信息
export const getOrderRefundData = (id) => {
  return request({
    url: '/Wechat/Order/getOrderRefundData',
    method: 'GET',
    data: { order_id: id }
  })
}
// 已支付待发货订单申请退款
export const applyOrderRefund = (data) => {
  return request({
    url: '/Wechat/Order/applyOrderRefund',
    method: 'POST',
    data
  })
}
// 获取租期
export const getOrderLease = (id) => {
  return request({
    url: '/Wechat/Order/getOrderLease',
    method: 'GET',
    data: { order_id: id }
  })
}

// 申请提前归还
export const orderApplyReturn = (order_id) => {
  return request({
    url: '/Wechat/Order/orderApplyReturn',
    method: 'POST',
    data: { order_id }
  })
}
// 获取快递
export const getReturnExpressList = () => {
  return request({
    url: '/Wechat/Order/getReturnExpressList',
    method: 'GET'
  })
}// 撤销提前归还申请
export const orderReturnCancel = (order_id) => {
  return request({
    url: '/Wechat/Order/orderReturnCancel',
    method: 'POST',
    data: { order_id }
  })
}
// 订单归还添加快递信息
export const orderReturnAddExpress = (data) => {
  return request({
    url: '/Wechat/Order/orderReturnAddExpress',
    method: 'POST',
    data
  })
}
// 公证数据
export const getSignData = (data) => {
  return request({
    url: '/Wechat/Order/getSignData',
    method: 'GET',
    data
  })
}
// 上传图片、orderId
export const getSignImg = ( data ) => {
  return request({
    url: '/Wechat/Order/getSignImg',
    method: 'POST',
    data
  })
}
// 上传图片、orderId
export const setSignImg = ( data ) => {
  return request({
    url: '/Wechat/Order/setSignImg',
    method: 'POST',
    data
  })
}
// 商品详情
export const getGoodsInfo = (data) => {
  return request({
    url: '/Wechat/Goods/getGoodsInfo',
    method: 'GET',
    data
  })
}
// 生成商品
export const confirmOrder = (data) => {
  return request({
    url: '/Wechat/Order/confirmOrder',
    method: 'POST',
    data
  })
}
// 
export const orderPay1 = ( data ) => {
  return request({
    url: '/Wechat/Order/orderPay',
    method: 'POST',
    data
  })
}
// 
// 反欺诈下单后返回状态
export const fraudStatus = ( orderId ) => {
  return request({
    url: '/Wechat/Order/fraudStatus',
    method: 'POST',
    data: { orderId }
  })
}
// 反欺诈选监管机后确认
export const confirmFraud = ( data ) => {
  return request({
    url: '/Wechat/Order/confirmFraud',
    method: 'POST',
    data
  })
}